package homework.yuandan.exception;

import homework.yuandan.common.ResponseEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author polly
 * @date 2020-12-14 14:33
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AppException extends RuntimeException {
    private int code;
    private String message;
    public AppException(ResponseEnum responseEnum){
        this.code = responseEnum.getCode();
        this.message = responseEnum.getMsg();
    }
}
